frequencyTableCategoricalDialog <-
		function(){
	require(TeachingExtras)
	initializeDialog(title = gettext("Frequency table (categorical data)",domain="R-RcmdrPlugin.TeachingExtras"))
	xBox <- variableListBox(top, Factors(), title = gettext("Variable (pick one)",domain="R-RcmdrPlugin.TeachingExtras"))
	onOK <- function() {
		x <- getSelection(xBox)
		if (length(x) == 0) {
			errorCondition(recall = frequencyTableCategoricalDialog, message = gettext("You must select a variable.",domain="R-RcmdrPlugin.TeachingExtras"))
			return()
		}
		closeDialog()
		command <- paste("frequencyTableCategorical(", ActiveDataSet(), "$", x, ")", sep = "")
		doItAndPrint(command)
		activateMenus()
		tkfocus(CommanderWindow())
	}
	OKCancelHelp(helpSubject = "frequencyTableCategorical")
	tkgrid(getFrame(xBox), sticky = "nw")
	tkgrid(buttonsFrame, sticky = "w")
	dialogSuffix(rows = 2, columns = 2)
}


